﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;

namespace WindowsFormsApplication3.基础信息管理
{
    public partial class baseInfo_edit : Form
    {
        public string temp_ID, temp_name, temp_time, temp_location;
        public baseInfo_edit()
        {
            InitializeComponent();
        }

        private void baseInfo_edit_Load(object sender, EventArgs e)
        {
            text_materialID.Text   = temp_ID;
            text_materialName.Text = temp_name;
            dateTimePicker1.Text = temp_time;
            text_location.Text = temp_location;
        }

        private void button_OK_Click(object sender, EventArgs e)
        {
            try
            {
                权限管理.permissionManaging.mySql.excute_sql("insert into baseInfotable values ("
                    + text_materialID.Text + "," 
                    + "'" + text_materialName.Text + "',"
                    + "'" + dateTimePicker1.Text   + "',"
                    + "'" + text_location.Text     + "'"
                    + ")");
                Debug.WriteLine("insert into baseInfotable values ("
                    + text_materialID.Text + ","
                    + "'" + text_materialName.Text + "',"
                    + "'" + dateTimePicker1.Text + "',"
                    + "'" + text_location.Text + "'"
                    + ")");
                this.Dispose();

            }
            catch
            { 
            
            }
        }

        private void button_cancel_Click(object sender, EventArgs e)
        {
            try
            {
                权限管理.permissionManaging.mySql.excute_sql("insert into baseInfotable values ("
                       + temp_ID + ","
                       + "'" + temp_name + "',"
                       + "'" + temp_time + "',"
                       + "'" + temp_location + "'"
                       + ")");
                this.Dispose();
            }
            catch
            { 
            
            }
        }
    }
}
